Runs an external program.
Run ( "filename" [, "workingdir" [, flag[, standard_i/o_flag]]] )
Parameters
filename | The name of the executable (EXE, BAT, COM, or PIF) to run. |
workingdir | [optional] The working directory. |
flag | [optional] The "show" flag of the executed program: @SW_HIDE = Hidden window @SW_MINIMIZE = Minimized window @SW_MAXIMIZE = Maximized window |
standard_i/o_flag | [optional] Provide a meaningful handle to one or more STD I/O streams of the child process. 1 ($STDIN_CHILD) = Provide a handle to the child's STDIN stream 2 ($STDOUT_CHILD) = Provide a handle to the child's STDOUT stream 4 ($STDERR_CHILD) = Provide a handle to the child's STDERR stream |
Return Value
Success: | The PID of the process that was launched. |
Failure: | Depends on RunErrorsFatal; see Remarks. |
Remarks
To run DOS (console) commands, try Run(@ComSpec & " /c " & 'commandName', "", @SW_HIDE)
Related
RunAsSet, RunErrorsFatal (Option), RunWait, ShellExecute, ShellExecuteWait, StderrRead, StdinWrite, StdoutRead, ProcessClose
Example
Run("Notepad.exe", "", @SW_MAXIMIZE)